package com.metadata_system.common.db.entity;

import java.util.Date;
import javax.persistence.*;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Table(name = "md_email_verify_code")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class EmailVerifyCode {
    @Id
    private Integer id;

    /**
     * 设备ID
     */
    @Column(name = "device_id")
    private String deviceId;

    /**
     * 用户ID
     */
    private Integer uid;

    /**
     * 验证码
     */
    private String code;

    /**
     * 手机号码
     */
    private String email;

    /**
     * 事件类型
     */
    @Column(name = "event_type")
    private String eventType;

    /**
     * 状态: 0.关闭 1.开启
     */
    private Integer status;

    /**
     * 创建时间
     */
    @Column(name = "created_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createdTime;

    /**
     * 有效期
     */
    @Column(name = "expired_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date expiredTime;
}
